import type {AxiosRequestConfig, AxiosResponse} from 'axios'

export interface IInterceptors<T = AxiosResponse> {
    requestInterceptors?: (config: AxiosRequestConfig) => AxiosRequestConfig
    requestInterceptorsCatch?: (error: Error) => any
    responseInterceptors?: (res: T) => T
    responseInterceptorsCatch?: (error: Error) => any
}

export interface IRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
    interceptors?: IInterceptors<T>
}
